#include "BlackDeath.Core.h"

namespace BlackDeath
{
	namespace Core
	{
		class CGame;
		class CGameComponent;
		class CGameTime;

		class CGameComponentManager
		{
			private:
				#pragma region enums
				enum ComponentManagerState { Created, Initialized, LoadedContent, Updated, Drawn, Destroyed };
				#pragma endregion

				#pragma region Variables
				ComponentManagerState m_eState;
				BlackDeath::Core::CGame* m_pGame;
				std::vector<BlackDeath::Core::CGameComponent*> m_lComponents;
				std::vector<BlackDeath::Core::CDrawableGameComponent*> m_lDrawableComponents;
				#pragma endregion

			protected:				
				#pragma region Constructors and Destructor
				CGameComponentManager(BlackDeath::Core::CGame*);
				#pragma endregion

				#pragma region Methods
				void Initialize();
				void LoadContent();
				void Update(BlackDeath::Core::CGameTime*);
				void Draw(BlackDeath::Core::CGameTime*);
				#pragma endregion

			public:
				
				#pragma region Properties
				int Get_Count();
				std::vector<BlackDeath::Core::CGameComponent*>* Get_GameComponents();
				std::vector<BlackDeath::Core::CDrawableGameComponent*>* Get_DrawableGameComponents();
				#pragma endregion

				#pragma region Options
				void Clear();
				void Add(BlackDeath::Core::CGameComponent*);
				void Remove(BlackDeath::Core::CGameComponent*);
				#pragma endregion

				#pragma region Operator Overriden Methods
				BlackDeath::Core::CGameComponent* operator[] (const int);
				#pragma endregion

				friend class BlackDeath::Core::CGame;
		};
	}
}